package Thread;

public class ThreadDemo2 {
    public static void main(String[] args) {
        //线程任务
        Runnable r1 = new Runable1();
        Runnable r2 = new Runable2();
        //线程装线程任务，实现线程的复用
        Thread t1 = new Thread(r1);
        Thread t2 = new Thread(r2);
        t1.start();
        t2.start();
    }
}

class Runable1 implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("6");
        }
    }
}

class Runable2 implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("7");
        }
    }
}
